<template>
	<view class="content">
		<time-selector @selectTime="selectTimeEvent" :startTime="startTime" :endTime="endTime" selectedTabColor="red" selectedItemColor="#FF6146"></time-selector>
		<view>
			<text>您选中的时间:{{timeQuery}}</text>
		</view>
	</view>
</template>

<script>
import timeSelector from '@/components/zx-ui/zx-select-time/zx-select-time.vue';
export default {
	components: {
		timeSelector
	},
	data() {
		return {
			timeQuery: '当前未选择时间',
			startTime: '',
			endTime: ''
		};
	},
	onLoad(option) {
		if(option.startTime!=undefined){
			this.startTime = option.startTime
		}
		if(option.endTime!=undefined){
			this.endTime = option.endTime
		}
		console.log(this.startTime)
		console.log(this.endTime)
	},
	methods: {
		selectTimeEvent(time) {
			this.timeQuery = time;
			var that = this;
			setTimeout(function(){
				that.$api.prePage().selfgetTime = time;
				uni.navigateBack()
			},500);
			
		}
	}
};
</script>

<style>
page {
	height: 100%;
}
.content {
	text-align: center;
	height: 100%;
}

.logo {
	height: 200upx;
	width: 200upx;
	margin-top: 200upx;
}

.title {
	font-size: 36upx;
	color: #8f8f94;
}
</style>